home *** CD-ROM | disk | FTP | other *** search
/ Game Programming in C++ - Start to Finish / GameProgrammingS.iso / developer_install / CEGUISDK-0.4.1-VC6-Native.exe / {app} / include / falagard / CEGUIFalLayerSpecification.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-08-21  |  4.7 KB  |  150 lines

  1. /************************************************************************
  2.     filename:   CEGUIFalLayerSpecification.h
  3.     created:    Mon Jun 13 2005
  4.     author:     Paul D Turner <paul@cegui.org.uk>
  5. *************************************************************************/
  6. /*************************************************************************
  7.     Crazy Eddie's GUI System (http://www.cegui.org.uk)
  8.     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
  9.  
  10.     This library is free software; you can redistribute it and/or
  11.     modify it under the terms of the GNU Lesser General Public
  12.     License as published by the Free Software Foundation; either
  13.     version 2.1 of the License, or (at your option) any later version.
  14.  
  15.     This library is distributed in the hope that it will be useful,
  16.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18.     Lesser General Public License for more details.
  19.  
  20.     You should have received a copy of the GNU Lesser General Public
  21.     License along with this library; if not, write to the Free Software
  22.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  23. *************************************************************************/
  24. #ifndef _CEGUIFalLayerSpecification_h_
  25. #define _CEGUIFalLayerSpecification_h_
  26.  
  27. #include "falagard/CEGUIFalSectionSpecification.h"
  28. #include "CEGUIWindow.h"
  29.  
  30. #if defined(_MSC_VER)
  31. #    pragma warning(push)
  32. #    pragma warning(disable : 4251)
  33. #endif
  34.  
  35. // Start of CEGUI namespace section
  36. namespace CEGUI
  37. {
  38.     /*!
  39.     \brief
  40.         Class that encapsulates a single layer of imagery.
  41.     */
  42.     class CEGUIEXPORT LayerSpecification
  43.     {
  44.     public:
  45.         /*!
  46.         \brief
  47.             Constructor.
  48.  
  49.         \param priority
  50.             Specifies the priority of the layer.  Layers with higher priorities will be drawn on top
  51.             of layers with lower priorities.
  52.         */
  53.         LayerSpecification(uint priority);
  54.  
  55.         /*!
  56.         \brief
  57.             Render this layer.
  58.  
  59.         \param srcWindow
  60.             Window to use when calculating pixel values from BaseDim values.
  61.  
  62.         \param base_z
  63.             base level z value to use for all imagery in the layer.
  64.  
  65.         \return
  66.             Nothing.
  67.         */
  68.         void render(Window& srcWindow, float base_z, const ColourRect* modcols = 0, const Rect* clipper = 0, bool clipToDisplay = false) const;
  69.  
  70.         /*!
  71.         \brief
  72.             Render this layer.
  73.  
  74.         \param srcWindow
  75.             Window to use when calculating pixel values from BaseDim values.
  76.  
  77.         \param baseRect
  78.             Rect to use when calculating pixel values from BaseDim values.
  79.  
  80.         \param base_z
  81.             base level z value to use for all imagery in the layer.
  82.  
  83.         \return
  84.             Nothing.
  85.         */
  86.         void render(Window& srcWindow, const Rect& baseRect, float base_z, const ColourRect* modcols = 0, const Rect* clipper = 0, bool clipToDisplay = false) const;
  87.  
  88.         /*!
  89.         \brief
  90.             Add a section specification to the layer.
  91.  
  92.             A section specification is a reference to a named ImagerySection within the WidgetLook.
  93.  
  94.         \param section
  95.             SectionSpecification object descibing the section that should be added to this layer.
  96.  
  97.         \return
  98.             Nothing,
  99.         */
  100.         void addSectionSpecification(const SectionSpecification& section);
  101.  
  102.         /*!
  103.         \brief
  104.             Clear all section specifications from this layer,
  105.  
  106.         \return
  107.             Nothing.
  108.         */
  109.         void clearSectionSpecifications();
  110.  
  111.         /*!
  112.         \brief
  113.             Return the priority of this layer.
  114.  
  115.         \return
  116.             uint value descibing the priority of this LayerSpecification.
  117.         */
  118.         uint getLayerPriority() const;
  119.  
  120.         // required to sort layers according to priority
  121.         bool operator<(const LayerSpecification& other) const;
  122.  
  123.         /*!
  124.         \brief
  125.             Writes an xml representation of this Layer to \a out_stream.
  126.  
  127.         \param out_stream
  128.             Stream where xml data should be output.
  129.  
  130.         \return
  131.             Nothing.
  132.         */
  133.         void writeXMLToStream(OutStream& out_stream) const;
  134.  
  135.     private:
  136.         typedef std::vector<SectionSpecification> SectionList;
  137.  
  138.         SectionList d_sections;         //!< Collection of SectionSpecification objects descibing the sections to be drawn for this layer.
  139.         uint        d_layerPriority;    //!< Priority of the layer.
  140.     };
  141.  
  142. } // End of  CEGUI namespace section
  143.  
  144.  
  145. #if defined(_MSC_VER)
  146. #    pragma warning(pop)
  147. #endif
  148.  
  149. #endif  // end of guard _CEGUIFalLayerSpecification_h_
  150.